package ca.etsmtl.log430.lab3.presentation;

import java.awt.Menu;
import java.util.Collection;
import java.util.Observable;

import ca.etsmtl.log430.lab3.gestion.ifaces.ICommonData;
import ca.etsmtl.log430.lab3.gestion.ifaces.ITeacher;
import ca.etsmtl.log430.lab3.presentation.cmdline.Displays;

public class ListCoursesPreviouslyTought extends Communication {

	
	
	/**
	 * @uml.property  name="systemInterface"
	 * @uml.associationEnd  multiplicity="(1 1)"
	 */
	ICommonData systemInterface;
	
	
	public ListCoursesPreviouslyTought(ICommonData systemInterface,Integer registrationNumber,
			String componentName) {
		super(registrationNumber, componentName);
		this.systemInterface=systemInterface;
		// TODO Auto-generated constructor stub
	}


	
	public void update(Observable thing, Object notificationNumber) {

		if (registrationNumber.compareTo((Integer) notificationNumber) == 0) {
			Displays display = new Displays();
					
			Collection<? extends ITeacher> teachers = systemInterface.getListOfTeachers();
			display.displayTeacherList(teachers);
			Menus menu= new Menus();
			ITeacher myTeacher = menu.pickTeacher();
			display.displayTeacher(myTeacher);
			display.displaySigleList((myTeacher.getCoursesTaughtList()));
		}
	}
	
	
	
	
	


}
